import java.io.File;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

import javax.swing.plaf.SliderUI;


public class TempFile {
	public static void main(String[] args) {
		
		
		try {
			File file = File.createTempFile("test", "txt");
			ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
			oos.writeObject(new String("sdflkj"));
			file.deleteOnExit();
			Thread.sleep(10000000000L);
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}
